    $(function () {
        question_list();
        var flag = true;
        $(".question_btn").click(function () {
            if (flag === true) {
                var name = $("input[name='name']", ".question_form").val();
                var tel = $("input[name='tel']", ".question_form").val();
                var question_txt = $("textarea[name='question']", ".question_form").val();
                question_txt = question_txt.trim();
                if (name == '') {
                    layer.msg("请输入您的姓名！", {
                        time: 2000
                    });
                    return;
                } else if (!(/^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/.test(name))) {
                    layer.msg("请检查您输入的姓名！", {
                        time: 2000
                    });
                    return;
                }
                if (tel == "") {
                    layer.msg("请输入您的电话！", {
                        time: 2000
                    });
                    return;
                } else if (!(/^1[3456789]\d{9}$/.test(tel))) {
                    layer.msg("请检查您输入的电话！", {
                        time: 2000
                    });
                    return;
                }
                if (question_txt == "") {
                    layer.msg("请输入您的问题和需求！", {
                        time: 2000
                    });
                    return;
                }
                if ((/^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/.test(name)) && (/^1[3456789]\d{9}$/.test(tel)) &&
                    question_txt != "") {
                    var question_url = document.URL;
                    flag = false;
                    $(this).attr("disabled", true);
                    $.ajax({
                        type: "post",
                        url: url + "/api/question/problem_commit",
                        data: {
                            nick: name,
                            phone: tel,
                            content: question_txt,
                            url: question_url
                        },
                        dataType: "json",
                        success: function (res) {
                            if (res.code == "1") {
                                layer.msg("提交成功，请留意来电！", {
                                    time: 2000
                                });
                                setTimeout(function () {
                                    $(".question_btn").attr("disabled", false);
                                }, 2000);
                            } else {
                                layer.msg("未知错误，请刷新页面后重试！", {
                                    time: 2000
                                });
                            }
                        }
                    });
                } else {
                    layer.msg("未知错误，请刷新页面后重试！", {
                        time: 2000
                    });
                    return;
                }
            } else {
                layer.msg("您已提交过问题，请留意来电！", {
                    time: 2000
                });
            }
        })
    })
    //单个消失
    function show_hide(id) {
        $(".answer", "#" + id).animate({
            height: 'hide'
        }, 500);
        $(".ask", "#" + id).css("background-color", "#f5f5f5");
        $(".ask_iocn", "#" + id).css({
            "background-color": "#F28179",
            "color": "#FFFFFF"
        });
        $(".ask_title", "#" + id).css("color", "rgba(51,51,51,1)");
        $(".ask_iocn_show", "#" + id).attr("src", url + "/themes/simpleboot3/public/assets/simpleboot3/yihe/images/ask_iocn.png");
        setTimeout(function () {
            $("#" + id).attr("flag", true);
        }, 500)
    }
    //所有消失
    function show_arr_hide(ask) {
        var new_ask_id = $(ask).parents(".question_list").attr("id");
        $(".question_list").not("#" + new_ask_id).find(".ask").css("background-color", "#F5F5F5");
        $(".question_list").not("#" + new_ask_id).find(".ask_iocn").css({
            "background-color": "#F28179",
            "color": "#FFFFFF"
        });
        $(".question_list").not("#" + new_ask_id).find(".ask_title").css("color", "rgba(51,51,51,1)");
        $(".question_list").not("#" + new_ask_id).find(".ask_iocn_show").attr("src",
            url + "/themes/simpleboot3/public/assets/simpleboot3/yihe/images/ask_iocn.png");
        $(".question_list").not("#" + new_ask_id).find(".answer").animate({
            height: 'hide'
        }, 500);
        setTimeout(function () {
            $(".question_list").not("#" + new_ask_id).attr("flag", true);
        }, 500)
    }

    var url = urls();
    var page = 1;

    function question_list() {
        $.ajax({
            type: "post",
            url: url + "/api/question/problem_list",
            data: {
                number: 5,
                page: page
            },
            dataType: "json",
            success: function (res) {
                question(res);
            }
        });
    }

    function question(res) {
        var arr = res.data.data;
        var pageNum = Math.ceil(res.data.total / 5);
        var a = ''
        for (i in arr) {
            a += '<div class="question_list" id="question_' + arr[i].id +
                '" flag=true><div class="ask"><p class="ask_iocn">问</p><p class="ask_title">' + arr[i].content +
                '</p><img src="' + url + '/themes/simpleboot3/public/assets/simpleboot3/yihe/images/ask_iocn.png" class="ask_iocn_show" /></div><div class="answer"><p class="answer_txt">律师：' +
                arr[i].remarks + '</p></div></div>'
        }
        $(".question_list_box").html(a);
        $(".ask").click(function () {
            show_arr_hide(this);
            var new_ask_id = $(this).parents(".question_list").attr("id");
            var ask_flag = $("#" + new_ask_id).attr("flag");
            if (ask_flag == "true") {
                $(this).css("background-color", "#F28179");
                $(".ask_iocn", this).css({
                    "background-color": "#FFFFFF",
                    "color": "#F28179"
                });
                $(".ask_title", this).css("color", "#FFFFFF");
                $(".ask_iocn_show", this).attr("src",
                    url + "/themes/simpleboot3/public/assets/simpleboot3/yihe/images/ask_active_iocn.png");
                $(".answer", "#" + new_ask_id).animate({
                    height: 'show'
                }, 500);
                setTimeout(function () {
                    $("#" + new_ask_id).attr("flag", false);
                }, 500)
            } else {
                show_hide(new_ask_id);
            }
        })
        $(".page_bg").css("display", "none");
        $("#page").paging({
            nowPage: page, // 当前页码
            pageNum: pageNum, // 总页码
            buttonNum: 7, //要展示的页码数量
            callback: function (num) { //回调函数
                $(".page_bg").css("display", "block");
                var top = $(".question_list_box").offset().top - 100;
                page = num;
                scrollTo(0,top);
                question_list();
            }
        });
    }